package DAO;

import POJO.Productcat;
import Util.DataAccessUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Nguyen Hong Phu (1142066) - 11HCB (HCMUS)
 */
public class ProductcatDAO {
     public static List<Productcat> getListProductCats(int storeId) throws Exception{
        String hql = "SELECT c from Productcat c "
                    +"LEFT JOIN FETCH c.store s "
                    +"WHERE s.id = :storeId";
       
        Map<String,Object> params = new HashMap<>();
        params.put("storeId", storeId);
        return DataAccessUtil.getList(hql,params);
    }
}
